Embodiments of the inventive concepts relate to a computer device and a storage device.
When an operating system (OS) deletes a file, a storage device does not erase a whole data block corresponding to the file but flags the block as “not in use”. When the storage device is a solid state drive (SSD), the block is erased before data is newly written to the block, which causes write performance to deteriorate.
To reduce performance deterioration, trim is used. When trim is used, an OS informs an SSD of cells not in use and the SSD invalidates the cells. Thereafter, the SSD can erase the cells in block units. To trigger trim, the OS in a host deletes a file first. Thereafter, the OS transmits a trim command to the SSD. Then, the SSD can invalidate the cells according to the trim command during an idle time of the host.
Meanwhile, a database (DB) can be managed as a single file. When a data structure (e.g., a table, a row, or a field) inside the DB is deleted, the file itself is not deleted, and therefore, trim does not operate. Therefore, even when a large amount of a data structure is deleted from the DB, an SSD does not erase a block corresponding to the data structure. As a result, inefficiency occurs in terms of available capacity and data writing speed of the SSD.